from django.conf.urls.defaults import *
from django.conf import settings



# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^MyBlog/', include('MyBlog.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
   )

urlpatterns+=patterns('MyBlog.Blog.views',
    (r'^article/(\d+)/$','show'),
    (r'^$','index',{'template':'index.html','c':'','t':''}),
    (r'^page/(?P<p>\d+)$','index',{'template':'index.html','c':'','t':''}),
    (r'^category/(?P<c>\d+)$','index',{'template':'blogs/category.html','t':''}),
    (r'^category/(?P<c>\d+)_(?P<p>\d+)$','index',{'template':'blogs/category.html','t':''}),
    (r'^tag/(?P<t>\d+)$','index',{'template':'blogs/tag.html','c':''}),
    (r'^tag/(?P<t>\d+)_(?P<p>\d+)$','index',{'template':'blogs/tag.html','c':''}),
    (r'^hit/(\d+)/$','hit'),
    (r'^comment/add/$','comment')
)

urlpatterns += patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
)

urlpatterns+= patterns('MyBlog.Blog.tests',
    (r'^test/$','testshow'),
)

#if not settings.DEBUG:
#    urlpatterns += patterns('',
#        (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
#    )
